from django.db import models

# Create your models here.
# #部门类型模型
# class DepartmentType(models.Model):
#     name=models.CharField(max_length=30,verbose_name='部门分类名称')
#     class Meta:
#         db_table='department_type'

#员工部门模型
class Department(models.Model):
    name=models.CharField(max_length=10,verbose_name='部门名称',unique=True)
    pid=models.ForeignKey('self',on_delete=models.SET_NULL,related_name='subs',null=True,blank=True,verbose_name='部门')
    def __str__(self):
        return self.name
    class Meta:
        db_table='department'
        ordering=('-id',)

